package coms.delegates;

import EJB.EJBLocator;
import coms.dto.Conference;
import coms.dto.ConferenceItem;
import coms.dto.ConferenceItemType;
import coms.ejb.ConferenceItemTypeBeanRemote;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ConferenceItemTypeDelegate  implements IDelegate<ConferenceItemType>{

    private ConferenceItemTypeBeanRemote conferenceItemTypeBean;
    
    public ConferenceItemTypeDelegate() {
        try {
            this.conferenceItemTypeBean = EJBLocator.lookupConferenceItemTypeBean();
        } catch (Exception ex) {
            Logger.getLogger(ConferenceItemTypeDelegate.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public boolean create(ConferenceItemType conferenceItemType) {
        conferenceItemTypeBean.create(conferenceItemType);
        return true;
    }

    @Override
    public boolean delete(ConferenceItemType conferenceItemType) {
        boolean deleted = conferenceItemTypeBean.delete(conferenceItemType);
        return deleted;
    }

    @Override
    public boolean update(ConferenceItemType conferenceItemType) {
        conferenceItemTypeBean.update(conferenceItemType);
        return true;
    }

    @Override
    public List<ConferenceItemType> search(ConferenceItemType t) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public List<ConferenceItemType> findAll() throws Exception {
       return conferenceItemTypeBean.findAll();
    }
    
     @Override
    public ConferenceItemType getById(int id) throws Exception {
       return conferenceItemTypeBean.getById(id);
    }
}
